window.onload=function(){
    var oBox=document.getElementsByClassName('photo_box')[0];

    var oUl=document.getElementsByClassName('photo_list abs')[0];

    var aLi=oUl.children;

    var oL=document.getElementsByClassName('photo_prev')[0];
    var oR=document.getElementsByClassName('photo_next')[0];

    oUl.innerHTML+=oUl.innerHTML;
    oUl.style.width=aLi[0].offsetWidth*aLi.length+'px';

    var n=0;
    var timer=null;

    oL.onclick=function(){
        clearInterval(timer);
        timer=setInterval(function(){
            n-=10;

            if(n<-oUl.offsetWidth/2){
                n=0;
            }

            oUl.style.left=n+'px';

        },100)
    };

    oR.onclick=function(){
        clearInterval(timer);
        timer=setInterval(function(){
            n+=10;

            if(n>0){
                n=-oUl.offsetWidth/2;
            }

            oUl.style.left=n+'px';

        },100)
    };
};